import request from "../utils/request";

const defualtCardData = {
    "code": 200,
    "data": [
      {
        "_id": "60bf1ed98bc1b814bc4783ed",
        "id": 18,
        "card_header": "156489",
        "card_type": "虚拟卡",
        "affiliation": "合伙人"
      },
      {
        "_id": "60bf1eeb8bc1b814bc4783ee",
        "id": 19,
        "card_header": "198223",
        "card_type": "实体卡",
        "affiliation": "合伙人"
      },
      {
        "_id": "60bf1ef88bc1b814bc4783ef",
        "id": 20,
        "card_header": "1592260817",
        "card_type": "实体卡",
        "affiliation": "合伙人"
      },
      {
        "_id": "60bf7b398bc1b814bc4783fb",
        "id": 23,
        "card_header": "201803674",
        "card_type": "实体卡",
        "affiliation": "合伙人"
      },
      {
        "_id": "60c016318bc1b814bc478404",
        "id": 25,
        "card_header": "55554444",
        "card_type": "实体卡",
        "affiliation": "大客户"
      },
      {
        "_id": "60c02ce58bc1b814bc478409",
        "id": 26,
        "card_header": "121331212",
        "card_type": "实体卡",
        "affiliation": "大客户"
      },
      {
        "_id": "60c07f188bc1b814bc478413",
        "id": 27,
        "card_header": "1031",
        "card_type": "实体卡",
        "affiliation": "合伙人"
      },
      {
        "_id": "60c0a02b8bc1b814bc478418",
        "id": 28,
        "card_header": "10000",
        "card_type": "实体卡",
        "affiliation": "大客户"
      }
    ]
}
export const findCardNumber = () => {
    return request.post("/api/findCardNumber").then(res => {
        if(res.code === 200){
          if(res.data?.length === 0) return defualtCardData;
          return res;
        }
    })
}

export const addCardNumber = (data) => {
  return request.post("/api/addCardNumber", data)
}